package com.tybbank.Activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.TextView;

import com.tybbank.Base.BaseActivity;
import com.tybbank.Login.LoginActivity;
import com.tybbank.R;
import com.tybbank.Utils.LocalManageUtil;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by Administrator on 2018/12/14 0014.
 */

public class YUYANActivity extends BaseActivity {
    @BindView(R.id.toolbar)
    Toolbar toolbar;
    @BindView(R.id.tv_chinese)
    TextView tvChinese;
    @BindView(R.id.tv_english)
    TextView tvEnglish;
    @BindView(R.id.tv_hanyu)
    TextView tvHanyu;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.layout_yuyan);
        ButterKnife.bind(this);
        toolbar(toolbar,getString(R.string.Language),R.mipmap.icon_close);


    }

    @OnClick({R.id.tv_chinese, R.id.tv_english, R.id.tv_hanyu})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.tv_chinese:   //
                selectLanguage(1);
                break;
            case R.id.tv_english:
                selectLanguage(3);
                break;
            case R.id.tv_hanyu://韩文
                selectLanguage(2);
                break;
        }
    }
    private void selectLanguage(int select) {
        LocalManageUtil.saveSelectLanguage(this, select);
        LoginActivity.reStart(this);
    }

    @Override
    public void LeftClose() {
        super.LeftClose();
        finish();
    }
}
